﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EventSet : MonoBehaviour {

    //メンバ変数
    GameObject card;

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
        if (transform.childCount == 0) {
            return;
        }else{
            card = transform.GetChild(0).gameObject;
            card.transform.localPosition = new Vector3(3, 0, 0);
        }
	}

    public void discard() {
        if (transform.childCount == 0) {
            return;
        }
        string parent = card.GetComponent<Card>().PARENT;
        card.transform.parent = null;
        card.transform.parent = transform.parent.Find(parent+"/Cards/Tomb").gameObject.transform;
        Debug.Log(card.name);
        card = null;
    }
}
